<!DOCTYPE html>
<html>
<head>
    <link rel="import" href="../_include/_jx.html?__inline">
</head>
<body>
<link rel="import" href="../_include/_loading.html?__inline">

<div class="jxpanel" style="border-radius: 4px;" data-options="fit:true">
    <form class="jxform">
        <table class='table jxtable-form'>
            <tr>
                <th class='w-100px'>发布名称</th>
                <td>
                    <input type='text' name='name' id='name' value='' class='form-control'
                           data-validate="{required:true}"
                           autocomplete='off'/>
                </td>
            </tr>
            <tr>
                <th>版本</th>
                <td>
                    <span id='buildBox'>
                        <select name='build' id='build' class='form-control jxselect'>
                            <option value='' selected='selected' data-keys=' '>请选择</option>
                            <option>张三</option>
                            <option>李四</option>
                        </select>
                    </span>
                </td>
            </tr>
            <tr>
                <th>发布日期</th>
                <td><input type='text' name='date' value='2017-12-09' class='form-control jxdate'/>
                </td>
            </tr>
            <tr>
                <th>描述</th>
                <td>
                    <textarea name='desc' id='desc' rows='10' style="resize: none" class='form-control'></textarea>
                </td>
            </tr>
            <tr>
                <th>附件</th>
                <td><span class="color-red">因为安全原因，Demo暂时不支持上传附件功能！</span></td>
            </tr>
        </table>
    </form>
    <div class="panel-footer text-right">
        <button class="btn btn-primary" type="submit">
            <i class="fa fa-save"></i> 保存
        </button>
        <button class="btn btn-default" type="button">
            <i class="fa fa-sign-in"></i> 取消
        </button>
    </div>
</div>

<script>
    jx.ready(function () {

        $('form').on('beforesubmit',function () {
            jx.alert('客户端验证通过,此处只是演示');
            return false;
        });

        $('button:eq(0)').click(function () {
            $('form').jxform().submit();
        });
        $('button:eq(1)').click(function () {
            jx.closeDialog($index);
        });
    });
</script>
</body>
</html>